package main

import (
	"fmt"
	"sync"
	"time"
)

var wg = sync.WaitGroup{}

func SendCode() {
	fmt.Println("发送验证码开始")
	time.Sleep(time.Second * 3)
	fmt.Println("发送验证码完成")
	wg.Done()
}
func main() {
	fmt.Println("主进程开始")
	wg.Add(1)
	go SendCode()
	fmt.Println("主进程其它逻辑")
	wg.Wait()
	fmt.Println("主进程完成")
}
